home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 August: Tool Chest / Dev.CD Aug 00 TC Disk 2.toast / pc / sample code / human interface toolbox / addresmenu7.1 / addresmenu7.1.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-06-23  |  3.6 KB  |  109 lines

  1. /*
  2.     File:        AddResMenu7.1.h
  3.  
  4.     Contains:    There is a small cosmetic bug in System 7.1 (a bug?  Can't even imagine the idea!).
  5.  
  6.                 AddResMenu will not alphabatize anything but FONT resource names.
  7.  
  8.                 This is obviously not critical, since the names still show up for
  9.                 other types, but enough people have written in to DTS to indicate
  10.                 that it matters a lot.
  11.  
  12.                 So, this small sample includes a function called MyAddResMenu which you
  13.                     can use in your applications to get the same functionality as
  14.                 AddResMenu under systems before 7.1, it will get all the resource info
  15.                 and add the names to the menu you specify.
  16.  
  17.                 Have a wonderful time with it.
  18.  
  19.     Written by: C.K. Haun    
  20.  
  21.     Copyright:    Copyright © 1991-1999 by Apple Computer, Inc., All Rights Reserved.
  22.  
  23.                 You may incorporate this Apple sample source code into your program(s) without
  24.                 restriction. This Apple sample source code has been provided "AS IS" and the
  25.                 responsibility for its operation is yours. You are not permitted to redistribute
  26.                 this Apple sample source code as "Apple sample source code" after having made
  27.                 changes. If you're going to re-distribute the source, we require that you make
  28.                 it clear in the source that the code was descended from Apple sample source
  29.                 code, but that you've made changes.
  30.  
  31.     Change History (most recent first):
  32.                 7/16/1999    Karl Groethe    Updated for Metrowerks Codewarror Pro 2.1
  33.                 
  34.  
  35. */
  36. #include <Types.h>
  37. #include <memory.h>
  38. #include <Packages.h>
  39. #include <Errors.h>
  40. #include <quickdraw.h>
  41. #include <fonts.h>
  42. #include <dialogs.h>
  43. #include <windows.h>
  44. #include <menus.h>
  45. #include <events.h>
  46. #include <OSEvents.h>
  47. #include <Desk.h>
  48. #include <diskinit.h>
  49. #include <OSUtils.h>
  50. #include <resources.h>
  51. #include <toolutils.h>
  52. #include <AppleEvents.h>
  53. #include <EPPC.h>
  54. #include <GestaltEqu.h>
  55. #include <PPCToolbox.h> 
  56. #include <Processes.h>
  57. #include <Balloons.h>
  58. #include <Aliases.h>
  59. #include <Scrap.h>
  60.  
  61. /* windowControl is the structure attached to every window I create (in the refCon */
  62. /* field) that contains all the information I need to know about the window. */
  63. /* data, procedure pointers for controlling, and anything else gets put in this */
  64. /* struct.  That makes my windows autonomous */
  65. struct windowControl {
  66.     unsigned long windowID;                                 /* master ID number  */
  67.     ProcPtr drawMe;                                         /* content drawing procedure pointer */
  68.     ProcPtr clickMe;                                        /* content click routine */
  69.     ProcPtr closeMe;                                        /* document close procedure pointer */
  70.     ProcPtr sizeMe;                                            /* size procedure */
  71.     AliasHandle fileAliasHandle;                            /* alias for this document */
  72.     Boolean windowDirty;
  73.     Handle generalData;                                        /* cast to whatever you need as you need it */
  74. };
  75. typedef struct windowControl windowControl, *windowCPtr, **windowCHandle;
  76.  
  77. enum {kDocWindowResID = 128,kMyDocumentWindow = 1000};
  78. /* menu enums */
  79. enum {kMBarID = 128};
  80. enum {kAppleMenu = 128,kFileMenu,kEditMenu,kToolsMenu};
  81.  
  82. /* file menu enums */
  83. enum {kNewItem = 1,kOpenItem,kCloseItem,kSaveItem,kSaveAsItem,kFileBlank1,kPageSetupItem,kPrintItem,kFileBlank2,kQuitItem};
  84.  
  85. /* general purpose enums */
  86. enum {kResumeMask=1,kSampHelp=129,kAboutBox=128,kHelpString=128,kBadSystem=130,kNoneOfThatType=132};
  87. enum {kResTypeDialog = 131,kResTypeEditLine=4};
  88. enum {kTestMenuChooseType = 1,kTestMenuDivider};
  89.  
  90. enum {kMinHeight = 200};
  91. enum {kGenStrings = 128,kUnnamedString=1};
  92.  
  93. enum  {
  94.     kEnterKey = 0x03, 
  95.     kTabKey = 9, 
  96.     kReturnKey = 0x0D, 
  97.     kBackSpace = 8, 
  98.     kEscKey = 0x1B, 
  99.     kLeftArrow = 0x1C, 
  100.     kRightArrow, 
  101.     kUpArrow,
  102.     kDownArrow, 
  103.     kDeleteKey = 0x7F
  104. };
  105.  
  106.  
  107.  
  108.  
  109.